export interface UserTableRowModel {
  delTime: string
  deptName: string
  id: number
  idNumber: string
  loginName: string
  mail: string
  phone: string
  sex: 1 | 2 | 3
  userName: string
  userNumber: string
}

export interface UserInfoModel {
  accountName: string // 开户名
  openingBank: string // 开户行
  bankCardNumber: string // 银行卡号
  payrollCardAccountName: string // 工资卡开户名
  payrollCardBank: string // 工资卡开户行
  payrollCardNumber: string // 工资卡银行卡号
  birthday: string // date-time
  carNumberList: string[]
  contactAddress: string
  createdBy: number // int32
  createdTime: string // date-time
  delFlag: number // int32
  headSculpture: string
  id: number // int32
  idNumber: string // int32
  loginName: string
  mail: string
  menuId: number // int32
  officePhone: string
  orderIndex: number // int32
  partyTime: string // date-time
  password: string
  phone: string
  politicalOutlookCode: string
  positionalTitles: string
  salt: string
  sex: number // int32
  updatedBy: number // int32
  updatedTime: string // date-time
  userName: string
  userNumber: string
  userPartyList: PartyOrganizationModel[]
  userPositionList: UserPositionModel[]
  userStatus: number // int32
}

export interface PartyOrganizationModel {
  id: number
  partyOrganizationCode: string
  partyPositionCode: string
  userId: number
}

export interface UserPositionModel {
  deptId: number
  id: number
  positionId: number
  userId: number
}

export type UserModel = {
  createdBy: number // 创建人
  createdTime: string // 创建时间
  delFlag: 0 | 1 // 是否删除 0否 1是
  deptId: number // 所属部门/单位id
  fullInstitutionName: string // 所属部门/单位名称
  dicName: string // 机构类型
  id: number // id
  job: string // 职务/职位
  loginName: string // 登录名
  mail: string // 邮箱
  menuId: number // 用户登录首页地址
  orderIndex: number // 排序号
  password: string // 密码
  phone: string // 手机号
  roleIdList: number[] // 功能角色&&流程角色
  salt: string // 密码加密盐
  sex: 1 | 2 // 性别 (1:男，2:女, 3:未知)
  updatedBy: number // 更新人
  updatedTime: string // 更新时间
  functionRoleId: number // 功能角色ID
  flowRoleId: number // 流程角色ID
  userName: string // 用户名
  userStatus: 0 | 1 // 用户状态 1：正常，0：禁用
  headSculpture: string //头像url
}

const api: ApiConfig = {
  info: {
    method: 'GET',
    url: '/sys/user/info/:id'
  },
  detailInfo: {
    method: 'GET',
    url: '/sys/user/detailInfo/:id'
  },
  list: {
    method: 'GET',
    url: '/sys/user/list'
  },
  delete: {
    method: 'POST',
    url: '/sys/user/delete'
  },
  updateUserRole: {
    method: 'POST',
    url: '/sys/user/updateUserRole'
  },
  copyUserRole: {
    method: 'POST',
    url: '/sys/user/copyUserRole'
  },
  save: {
    method: 'POST',
    url: '/sys/user/save'
  },
  update: {
    method: 'POST',
    url: '/sys/user/update'
  },
  password: {
    method: 'POST',
    url: '/sys/user/password'
  },
  setPassword: {
    method: 'POST',
    url: '/sys/user/setPassword'
  },
  pwd: {
    method: 'POST',
    url: '/sys/user/pwd'
  },
  permissionInfo: {
    method: 'GET',
    url: '/sys/user/permissionInfo/:userId'
  },
  checkUserNumber: {
    method: 'GET',
    url: '/sys/user/checkUserNumber'
  },
  getNewUserNumber: {
    method: 'GET',
    url: '/sys/user/getNewUserNumber'
  },
  getUserBankInfo: {
    method: 'GET',
    url: '/sys/user/getUserBankInfo/:cardType'
  }
}

export default api
